home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume11 / pc_xbd / patch2b < prev    next >
Encoding:
Internet Message Format  |  1991-04-03  |  54.2 KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.tek.com (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v12i049:  pc-xbd - Boulder Dash for PC-VGA, Patch2b
  5. Message-ID: <917@masterCNA.TEK.COM>
  6. Date: 9 Mar 91 00:20:17 GMT
  7. Sender: news@masterCNA.TEK.COM
  8. Lines: 2268
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: soulard@fantasio.inria.fr (Herve Soulard)
  12. Posting-number: Volume 12, Issue 49
  13. Archive-name: pc-xbd/Patch2b
  14. Patch-To: pc-xbd: Volume 11, Issue 81-83
  15. Environment: PC, MS-DOS
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 2 (of 4)."
  25. # Contents:  bitmaps/xbdlv100 patches02 sound.c sound.h sound_as.asm
  26. # Wrapped by billr@saab on Fri Mar  8 16:13:13 1991
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'bitmaps/xbdlv100' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'bitmaps/xbdlv100'\"
  30. else
  31. echo shar: Extracting \"'bitmaps/xbdlv100'\" \(966 characters\)
  32. sed "s/^X//" >'bitmaps/xbdlv100' <<'END_OF_FILE'
  33. X25 35 10 122 10 100 200 230 1250 Cruise_Eater by lotridge@bnl.gov
  34. XSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
  35. XSgggSSgggSSgggSSgggSWgbbbbbbbbbbbbS
  36. XSgggSSgggSSgggSSgggSWgwbbbbbbbbbbbS
  37. XSgggggggggggggggggggggSgbbbbbbbbbbS
  38. XSSSgSSSSgSSSSgSSSSgSSSSgbdbbwwwwwwS
  39. XSglglgglglgglglgglglglglgggg gggdgS
  40. XSlg gngg gngg gngg gnSSgggtg gggWgS
  41. XSgg dgbg dgbg dgbg dgSgggggg gggggS
  42. XSllgbgglgbgglgbgglgbgSWggggg gggggS
  43. XSbglgggglgggglgggglggSgggggg     gS
  44. XSggggbdgggbdgggbdggggSWgtggWwwWg gS
  45. XSgglgglblgglblgglblggSgggggggggw gS
  46. XSgggglgggglgggglgggggSgggggggWgwlgS
  47. XSblgggblgggblgggblgggSWgWgtggWggggS
  48. XSggb gggb gggb gggbglSggggggggwwggS
  49. XElglglgglglgglglggglgSgggggggggWggS
  50. XSgggnggggnggggnggggnbSWgWgWgtggWggS
  51. XSSSSSSSSSSSSSSSSSSSSSSgggggggggwggS
  52. XSdddddddddddddddddd eSggggggggggggS
  53. XSddddddddddddddddddd SWgWgWgWgtgggS
  54. XSSSSSSSSSSSSSSSSSSdSdSggggggggggggS
  55. XSdddddddddddddddddddgSWpWgWgWgggggS
  56. XSdSdSSSSSSSSSSSSSSSSSSggggggggggggS
  57. XSgddddddddddddddddddddggggggggggggS
  58. XSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
  59. END_OF_FILE
  60. if test 966 -ne `wc -c <'bitmaps/xbdlv100'`; then
  61.     echo shar: \"'bitmaps/xbdlv100'\" unpacked with wrong size!
  62. fi
  63. # end of 'bitmaps/xbdlv100'
  64. fi
  65. if test -f 'patches02' -a "${1}" != "-c" ; then 
  66.   echo shar: Will not clobber existing file \"'patches02'\"
  67. else
  68. echo shar: Extracting \"'patches02'\" \(40831 characters\)
  69. sed "s/^X//" >'patches02' <<'END_OF_FILE'
  70. X*** Makefile    Sat Dec  1 13:16:56 1990
  71. X--- ../todo/pc-xbd2/Makefile    Fri Mar  8 15:58:08 1991
  72. X***************
  73. X*** 4,11 ****
  74. X  BITMAP        = bitmap.exe
  75. X  GAME            = xbd.exe
  76. X  EDITOR          = xbde.exe
  77. X  
  78. X! PROGRAMS        = ${BITMAP} ${GAME} ${EDITOR}
  79. X  
  80. X  #CFLAGS      = /AS /Zi /Gs 
  81. X  #LDFLAGS    = /Stack:8192 /CO /NOE /NOI
  82. X--- 4,12 ----
  83. X  BITMAP        = bitmap.exe
  84. X  GAME            = xbd.exe
  85. X  EDITOR          = xbde.exe
  86. X+ CONVERT         = convert.exe
  87. X  
  88. X! PROGRAMS        = ${BITMAP} ${GAME} ${EDITOR} ${CONVERT}
  89. X  
  90. X  #CFLAGS      = /AS /Zi /Gs 
  91. X  #LDFLAGS    = /Stack:8192 /CO /NOE /NOI
  92. X***************
  93. X*** 14,39 ****
  94. X  CFLAGS         = /AS /Ot /Gs
  95. X  LDFLAGS        = /Stack:8192 /NOE /NOI
  96. X  ASFLAGS        = /Mx
  97. X  
  98. X! LEVELS          = xbdlev001 xbdlev002 xbdlev003 xbdlev004 xbdlev005 \
  99. X!                   xbdlev006 xbdlev007 xbdlev008 xbdlev009 xbdlev010 \
  100. X!                   xbdlev011 xbdlev012 xbdlev013 xbdlev014 xbdlev015 \
  101. X!                   xbdlev016 xbdlev017 xbdlev018 xbdlev019 xbdlev020 \
  102. X!                   xbdlev021 xbdlev022 xbdlev023 xbdlev024 xbdlev025 \
  103. X!                   xbdlev026 xbdlev027 xbdlev028 xbdlev029 xbdlev030 \
  104. X!                   xbdlev031 xbdlev032 xbdlev033 xbdlev034 xbdlev035 \
  105. X!                   xbdlev036 xbdlev037 xbdlev038
  106. X! 
  107. X! OBJS1   = xbd.obj shared.obj field.obj scores.obj graph.obj
  108. X  OBJS2   = xbde.obj shared.obj graph.obj
  109. X  OBJS3   = bitmap.obj graph.obj
  110. X  
  111. X! SRCS1   = xbd.obj shared.obj field.obj scores.obj graph.obj
  112. X  SRCS2   = xbde.obj shared.obj graph.obj
  113. X  SRCS3   = bitmap.obj graph.obj
  114. X  
  115. X  
  116. X- 
  117. X  all:: ${PROGRAMS}
  118. X  
  119. X  ${GAME}: ${OBJS1}
  120. X--- 15,43 ----
  121. X  CFLAGS         = /AS /Ot /Gs
  122. X  LDFLAGS        = /Stack:8192 /NOE /NOI
  123. X  ASFLAGS        = /Mx
  124. X+    
  125. X+ LEVELS          = xbdlv001 xbdlv002 xbdlv003 xbdlv004 xbdlv005 \
  126. X+                   xbdlv006 xbdlv007 xbdlv008 xbdlv009 xbdlv010 \
  127. X+                   xbdlv011 xbdlv012 xbdlv013 xbdlv014 xbdlv015 \
  128. X+                   xbdlv016 xbdlv017 xbdlv018 xbdlv019 xbdlv020 \
  129. X+                   xbdlv021 xbdlv022 xbdlv023 xbdlv024 xbdlv025 \
  130. X+                   xbdlv026 xbdlv027 xbdlv028 xbdlv029 xbdlv030 \
  131. X+                   xbdlv031 xbdlv032 xbdlv033 xbdlv034 xbdlv035 \
  132. X+                   xbdlv036 xbdlv037 xbdlv038 xbdlv100
  133. X  
  134. X! OBJS1   = xbd.obj shared.obj field.obj scores.obj graph.obj sound.obj \
  135. X!       sound_as.obj
  136. X  OBJS2   = xbde.obj shared.obj graph.obj
  137. X  OBJS3   = bitmap.obj graph.obj
  138. X+ OBJS4   = convert.obj
  139. X  
  140. X! SRCS1   = xbd.obj shared.obj field.obj scores.obj graph.obj sound.obj \
  141. X!       sound_as.obj
  142. X  SRCS2   = xbde.obj shared.obj graph.obj
  143. X  SRCS3   = bitmap.obj graph.obj
  144. X+ SRCS4    = convert.obj
  145. X  
  146. X  
  147. X  all:: ${PROGRAMS}
  148. X  
  149. X  ${GAME}: ${OBJS1}
  150. X***************
  151. X*** 54,58 ****
  152. X  clean::
  153. X      $(RM) ${EDITOR}
  154. X  
  155. X  
  156. X! 
  157. X--- 58,65 ----
  158. X  clean::
  159. X      $(RM) ${EDITOR}
  160. X  
  161. X+ ${CONVERT}: ${OBJS4}
  162. X+     $(LINK) $(LDFLAGS) ${OBJS4};
  163. X  
  164. X! clean::
  165. X!     $(RM) ${CONVERT}
  166. X*** bitmap.c    Sat Dec  1 13:08:26 1990
  167. X--- ../todo/pc-xbd2/bitmap.c    Fri Mar  8 15:58:24 1991
  168. X***************
  169. X*** 108,120 ****
  170. X      ptrBitmap = bitmap[num];
  171. X      makePgm(ptrBitmap,pgms[num]);
  172. X      
  173. X!     drawPgm(num * 3,8,pgms[num],_GPSET);
  174. X  
  175. X!     _settextposition(3,0);
  176. X      _outtext("                                                                               ");
  177. X-     _settextposition(3,1 + (num * 3));
  178. X-     _outtext("^");
  179. X      
  180. X      _settextposition(5,50);
  181. X      _outtext("                    ");
  182. X      _settextposition(5,50);
  183. X--- 108,121 ----
  184. X      ptrBitmap = bitmap[num];
  185. X      makePgm(ptrBitmap,pgms[num]);
  186. X      
  187. X!     drawPgm(num, 1, pgms[num], _GPSET);
  188. X  
  189. X!     _settextposition(3, 0);
  190. X      _outtext("                                                                               ");
  191. X      
  192. X+     _setcolor(15);
  193. X+     _rectangle(_GFILLINTERIOR, 7 + (16 * num), 36, 9 + (16 * num), 41);
  194. X+     
  195. X      _settextposition(5,50);
  196. X      _outtext("                    ");
  197. X      _settextposition(5,50);
  198. X***************
  199. X*** 282,288 ****
  200. X      makePgms();
  201. X      
  202. X      for (aux=0;aux < MAXPGM; aux++)
  203. X!         drawPgm(aux * 3,8,pgms[aux],_GPSET);
  204. X  
  205. X      drawBitmap(num);
  206. X  
  207. X--- 283,289 ----
  208. X      makePgms();
  209. X      
  210. X      for (aux=0;aux < MAXPGM; aux++)
  211. X!         drawPgm(aux, 1, pgms[aux], _GPSET);
  212. X  
  213. X      drawBitmap(num);
  214. X  
  215. X*** field.c    Wed Nov 28 21:03:12 1990
  216. X--- ../todo/pc-xbd2/field.c    Fri Mar  8 15:58:52 1991
  217. X***************
  218. X*** 15,27 ****
  219. X  #include <signal.h>
  220. X  #include <time.h>
  221. X  #include <sys/timeb.h>
  222. X  #include "xbd.h"
  223. X  
  224. X! void blink(i, j)
  225. X! int    i, j;
  226. X! {
  227. X!     field[i][j].changed = TRUE;
  228. X! }
  229. X  
  230. X  
  231. X  void move_cell(i, j, ii, jj)
  232. X--- 15,24 ----
  233. X  #include <signal.h>
  234. X  #include <time.h>
  235. X  #include <sys/timeb.h>
  236. X+ 
  237. X  #include "xbd.h"
  238. X  
  239. X! #define blink(i,j)    field[i][j].changed = TRUE;
  240. X  
  241. X  
  242. X  void move_cell(i, j, ii, jj)
  243. X***************
  244. X*** 380,385 ****
  245. X--- 377,383 ----
  246. X                                  case GRASS:
  247. X                                  case DIAMOND:
  248. X                                      if (field[ii][jj].content == DIAMOND) {
  249. X+                                         playSound(sndWhizz);
  250. X                                          if (curorder == UP && field[ii][jj].speed)
  251. X                                              break;
  252. X                                          score += diapoints;
  253. X***************
  254. X*** 411,416 ****
  255. X--- 409,415 ----
  256. X                                          else
  257. X                                              set_cell(ii, jj, SPACE);
  258. X                                          if (!levincreased) {
  259. X+                                             playSound(sndYahoo);
  260. X                                              levelnum++;
  261. X                                              lives++;
  262. X                                              levincreased = TRUE;
  263. X***************
  264. X*** 508,513 ****
  265. X--- 507,513 ----
  266. X                              jjj++;
  267. X                          break;
  268. X                      case EXPLOSION:
  269. X+                         playSound(sndExplode);
  270. X                          jjj = field[i][j].stage;
  271. X                          if (!(jjj % 5)) {
  272. X                              jjj++;        /* use jjj for setting new stage */
  273. X***************
  274. X*** 622,630 ****
  275. X          tgc = (tgc == tgc1) ? tgc2 : tgc1;
  276. X      if (!diareq) {
  277. X          Egc = (Egc == Egc1) ? Egc2 : Egc1;
  278. X!     if (diareq == 0) {
  279. X!         diapoints = extradiapoints;
  280. X!         scoreobs = TRUE;
  281. X      }
  282. X- }
  283. X  }
  284. X--- 622,630 ----
  285. X          tgc = (tgc == tgc1) ? tgc2 : tgc1;
  286. X      if (!diareq) {
  287. X          Egc = (Egc == Egc1) ? Egc2 : Egc1;
  288. X!         if (diareq == 0) {
  289. X!             diapoints = extradiapoints;
  290. X!             scoreobs = TRUE;
  291. X!         }
  292. X      }
  293. X  }
  294. X*** graph.asm    Tue Nov 27 21:10:38 1990
  295. X--- ../todo/pc-xbd2/graph.asm    Fri Mar  8 15:59:04 1991
  296. X***************
  297. X*** 6,11 ****
  298. X--- 6,53 ----
  299. X  
  300. X  
  301. X  
  302. X+ ;-----    Appel d'une fonction DOS.
  303. X+ ;
  304. X+ WRITE_BM    MACRO    
  305. X+ 
  306. X+     movsw                ; 16 words to write for
  307. X+     add    di, cx            ; drawing the bitmap in 
  308. X+     movsw                ; the active plan
  309. X+     add    di, cx
  310. X+     movsw
  311. X+     add    di, cx
  312. X+     movsw
  313. X+     add    di, cx
  314. X+     movsw
  315. X+     add    di, cx
  316. X+     movsw
  317. X+     add    di, cx
  318. X+     movsw
  319. X+     add    di, cx
  320. X+     movsw
  321. X+     add    di, cx
  322. X+     movsw
  323. X+     add    di, cx
  324. X+     movsw
  325. X+     add    di, cx
  326. X+     movsw
  327. X+     add    di, cx
  328. X+     movsw
  329. X+     add    di, cx
  330. X+     movsw
  331. X+     add    di, cx
  332. X+     movsw
  333. X+     add    di, cx
  334. X+     movsw
  335. X+     add    di, cx
  336. X+     movsw
  337. X+     add    di, cx
  338. X+ 
  339. X+ 
  340. X+         ENDM
  341. X+ 
  342. X+ 
  343. X+ 
  344. X      .MODEL    SMALL
  345. X  
  346. X  
  347. X***************
  348. X*** 32,42 ****
  349. X      mov    es, ax
  350. X  
  351. X      mov    ax, word ptr [BP+06h]    ; y
  352. X!     mov    bx, 80
  353. X!     mul    bx
  354. X!     add    ax, word ptr [BP+04h]    ; x
  355. X!     mov    di, ax
  356. X  
  357. X      mov    si, word ptr [BP+08h]    ; pgm
  358. X      add    si, 4
  359. X  
  360. X--- 74,91 ----
  361. X      mov    es, ax
  362. X  
  363. X      mov    ax, word ptr [BP+06h]    ; y
  364. X!     mov    bx, ax
  365. X!     mov    cl, 10
  366. X!     shl    bx, cl            ; y * 64 * 16
  367. X!     mov    cl, 8
  368. X!     shl    ax, cl            ; y * 16 * 16
  369. X  
  370. X+     add    bx, ax            ; y * 80 = (y * 64) + (y * 16) 
  371. X+ 
  372. X+     mov    ax, word ptr [BP+04h]    ; x
  373. X+     shl    ax, 1
  374. X+     add    bx, ax
  375. X+ 
  376. X      mov    si, word ptr [BP+08h]    ; pgm
  377. X      add    si, 4
  378. X  
  379. X***************
  380. X*** 57,115 ****
  381. X  
  382. X  
  383. X      mov    dx, 03C4h
  384. X!     mov    bx, 78
  385. X  
  386. X  
  387. X!     push    di
  388. X!     mov    cx, 16    
  389. X      mov    ax, 0102h        ; Enable PLAN 0
  390. X      out    dx, ax
  391. X! l1:
  392. X!     movsw
  393. X!     add    di, bx
  394. X!     loop    l1
  395. X!     pop    di
  396. X  
  397. X! 
  398. X!     push    di
  399. X!     mov    cx, 16
  400. X      shl    ah, 1            ; Enable PLAN 1
  401. X      out    dx, ax
  402. X! l2:
  403. X!     movsw
  404. X!     add    di, bx
  405. X!     loop    l2
  406. X!     pop    di
  407. X  
  408. X! 
  409. X!     push    di
  410. X!     mov    cx, 16
  411. X      shl    ah, 1            ; Enable PLAN 2
  412. X      out    dx, ax
  413. X! l3:
  414. X!     movsw
  415. X!     add    di, bx
  416. X!     loop    l3
  417. X!     pop    di
  418. X  
  419. X! 
  420. X!     mov    cx, 16
  421. X      shl    ah, 1            ; Enable PLAN 3
  422. X      out    dx, ax
  423. X! l4:
  424. X!     movsw
  425. X!     add    di, bx
  426. X!     loop    l4
  427. X! 
  428. X      
  429. X      mov    ax, 0F02h
  430. X      out    dx, ax
  431. X  
  432. X      mov    dx, 03CEh
  433. X!     
  434. X!     mov    ax, 0000h
  435. X      out    dx, ax
  436. X!     mov    ax, 0001h
  437. X      out    dx, ax
  438. X      mov    ax, 0FF08h
  439. X      out    dx, ax
  440. X--- 106,142 ----
  441. X  
  442. X  
  443. X      mov    dx, 03C4h
  444. X!     mov    cx, 78
  445. X  
  446. X  
  447. X!     mov    di, bx
  448. X      mov    ax, 0102h        ; Enable PLAN 0
  449. X      out    dx, ax
  450. X!     WRITE_BM
  451. X  
  452. X!     mov    di, bx
  453. X      shl    ah, 1            ; Enable PLAN 1
  454. X      out    dx, ax
  455. X!     WRITE_BM
  456. X  
  457. X!     mov    di, bx
  458. X      shl    ah, 1            ; Enable PLAN 2
  459. X      out    dx, ax
  460. X!     WRITE_BM
  461. X  
  462. X!     mov    di, bx
  463. X      shl    ah, 1            ; Enable PLAN 3
  464. X      out    dx, ax
  465. X!     WRITE_BM
  466. X      
  467. X      mov    ax, 0F02h
  468. X      out    dx, ax
  469. X  
  470. X      mov    dx, 03CEh
  471. X! 
  472. X!     xor    ax, ax            ; ax = 0000h
  473. X      out    dx, ax
  474. X!     inc    ax            ; ax = 0001h
  475. X      out    dx, ax
  476. X      mov    ax, 0FF08h
  477. X      out    dx, ax
  478. X*** patchlev.h    Mon Nov  5 02:46:22 1990
  479. X--- ../todo/pc-xbd2/patchlev.h    Fri Mar  8 15:59:11 1991
  480. X***************
  481. X*** 1 ****
  482. X! #define PATCHLEVEL 0
  483. X--- 1 ----
  484. X! #define PATCHLEVEL 2
  485. X*** readme.pc    Sat Dec  1 13:14:54 1990
  486. X--- ../todo/pc-xbd2/readme.pc    Fri Mar  8 15:59:19 1991
  487. X***************
  488. X*** 36,41 ****
  489. X--- 36,42 ----
  490. X      - XBD.EXE, the game,
  491. X      - XBDE.EXE, level editor for XBD.EXE,
  492. X      - BITMAP.EXE, bitmap editor for XBD.EXE.
  493. X+     - CONVERT.EXE, convert raw sound file to my format.
  494. X  
  495. X  
  496. X  
  497. X***************
  498. X*** 47,53 ****
  499. X  
  500. X      You also need to copied some files to the play directory or
  501. X      another one. This later one can be set in the file XBD.H
  502. X!     with the LIB define, or with the XBDLIB environment variable.
  503. X          
  504. X      Those files are :
  505. X          - xbdlv*, levels for the game,
  506. X--- 48,55 ----
  507. X  
  508. X      You also need to copied some files to the play directory or
  509. X      another one. This later one can be set in the file XBD.H
  510. X!     with the LIB define, or with the XBDLIB environment variable
  511. X!     (default to .\lib).
  512. X          
  513. X      Those files are :
  514. X          - xbdlv*, levels for the game,
  515. X***************
  516. X*** 55,61 ****
  517. X          - bitmaps.dat, all bitmaps used by the game,
  518. X          - scores, all scores.
  519. X  
  520. X!     You find those files in the BITMAPS directory.
  521. X  
  522. X  
  523. X      If you want your real name in the score file, you must set
  524. X--- 57,63 ----
  525. X          - bitmaps.dat, all bitmaps used by the game,
  526. X          - scores, all scores.
  527. X  
  528. X!     You find those files in the LIB directory.
  529. X  
  530. X  
  531. X      If you want your real name in the score file, you must set
  532. X***************
  533. X*** 67,73 ****
  534. X  -----------
  535. X  
  536. X      The Makefile is writen for GMAKE (GNU make) and use the
  537. X!     Microsoft C compiler and Assembler. 
  538. X  
  539. X  
  540. X  
  541. X--- 69,75 ----
  542. X  -----------
  543. X  
  544. X      The Makefile is writen for GMAKE (GNU make) and use the
  545. X!     Microsoft C compiler (6.0) and Assembler (5.0).
  546. X  
  547. X  
  548. X  
  549. X***************
  550. X*** 74,81 ****
  551. X  XBD.EXE
  552. X  -------
  553. X  
  554. X!     Usage : XBD [-l level]
  555. X  
  556. X      The goal is to collect the more of diamonds, the exit to next
  557. X      level will blink when you will get enough diamond. New level
  558. X      gives you one life more. For each level you have a limited
  559. X--- 76,87 ----
  560. X  XBD.EXE
  561. X  -------
  562. X  
  563. X!     Usage : XBD [-l level] [-s]
  564. X  
  565. X+         -l -> starting level.
  566. X+         -s -> disable digitized sounds.
  567. X+ 
  568. X+ 
  569. X      The goal is to collect the more of diamonds, the exit to next
  570. X      level will blink when you will get enough diamond. New level
  571. X      gives you one life more. For each level you have a limited
  572. X***************
  573. X*** 85,90 ****
  574. X--- 91,97 ----
  575. X      Keys used within the game :
  576. X  
  577. X          - ARROWS, move the guy,
  578. X+         - CTRL-ARROWS, dig around the guy,
  579. X          - 'R' or 'r', redraw the screen,
  580. X          - 'D' or 'd', kill the guy,
  581. X          - SPACE, pauses the game,
  582. X***************
  583. X*** 96,101 ****
  584. X--- 103,113 ----
  585. X  
  586. X      Usage : XBDE [-h heigth] [-w width] -l level
  587. X  
  588. X+         -h -> heigth of the level screen.
  589. X+         -w -> width of the level screen.
  590. X+         -l -> level to be editied.
  591. X+ 
  592. X+ 
  593. X      With XBDE you can edit the level files for XBD. Those files
  594. X      must be in the current directory, or in the directory
  595. X      precised by XBDLIB.
  596. X***************
  597. X*** 123,128 ****
  598. X--- 135,141 ----
  599. X  
  600. X      Usage : BITMAP
  601. X  
  602. X+ 
  603. X      This program allows you to edit all bitmaps available in the
  604. X      BITMAPS.DAT file. This file must be in the current directory,
  605. X      and after editing you must copy it in the play directory or
  606. X***************
  607. X*** 148,151 ****
  608. X  
  609. X      On the left of all colors a square indicates the current
  610. X      color, and on the right another square gives the color of the
  611. X!     current pixel.
  612. X--- 161,191 ----
  613. X  
  614. X      On the left of all colors a square indicates the current
  615. X      color, and on the right another square gives the color of the
  616. X!     current pixel.
  617. X! 
  618. X! 
  619. X! 
  620. X! CONVERT.EXE
  621. X! -----------
  622. X! 
  623. X!     Usage : CONVERT  <InFile> <Hertz> <OutFile> <Comment>
  624. X! 
  625. X!         InFile  -> name of raw sound file.
  626. X!         Hertz   -> digitize frequency of InFile.
  627. X!         OutFile -> name of my format file.
  628. X!         Comment -> comment to add to the OutFile.
  629. X! 
  630. X! 
  631. X!     This program convert a raw sampled sound file to my own format.
  632. X!     Each sampled is supposed to be a 8 bits value with the middle
  633. X!     value to 128. You have to give the frequency this file is 
  634. X!     digitized with.
  635. X! 
  636. X!     The OutFile is composed of the datas from the InFile with an 
  637. X!     header describing the sound. I recommend to use the '.PSF' 
  638. X!     extension for this file.
  639. X! 
  640. X!     You can add a comment to the file, like the title of the sound, 
  641. X!     up to 250 characters.
  642. X! 
  643. X!     
  644. X*** scores    Thu Nov 29 23:38:22 1990
  645. X--- ../todo/pc-xbd2/scores    Fri Mar  8 15:59:46 1991
  646. X***************
  647. X*** 15,20 ****
  648. X  1160 37 37 houttuin 
  649. X  1120 77 78 houttuin 
  650. X  1110 2 3 houttuin 
  651. X  1020 77 77 houttuin 
  652. X  972 2 3 (null) 
  653. X- 960 25 25 houttuin 
  654. X--- 15,20 ----
  655. X  1160 37 37 houttuin 
  656. X  1120 77 78 houttuin 
  657. X  1110 2 3 houttuin 
  658. X+ 1062 2 3 Herv 
  659. X  1020 77 77 houttuin 
  660. X  972 2 3 (null) 
  661. X*** scores.c    Wed Nov 28 21:03:36 1990
  662. X--- ../todo/pc-xbd2/scores.c    Fri Mar  8 15:59:55 1991
  663. X***************
  664. X*** 105,111 ****
  665. X              next.desc, next.elev, next.slev, next.score);
  666. X      }
  667. X      /* Save new high score list to score file */
  668. X!     sprintf(buf, "%s/scores", LIB);
  669. X      sfile = fopen(buf, "w");
  670. X      if (sfile == NULL) {
  671. X          perror(buf);
  672. X--- 105,115 ----
  673. X              next.desc, next.elev, next.slev, next.score);
  674. X      }
  675. X      /* Save new high score list to score file */
  676. X!     if (aux = getenv("XBDLIB"))
  677. X!         sprintf(buf, "%s/scores", aux);
  678. X!     else
  679. X!         sprintf(buf, "%s/scores", LIB);
  680. X!     
  681. X      sfile = fopen(buf, "w");
  682. X      if (sfile == NULL) {
  683. X          perror(buf);
  684. X*** shared.c    Thu Nov 29 11:46:54 1990
  685. X--- ../todo/pc-xbd2/shared.c    Fri Mar  8 16:00:09 1991
  686. X***************
  687. X*** 120,131 ****
  688. X  
  689. X  void load()
  690. X  {
  691. X!     FILE *map;
  692. X!     int i,j,k;
  693. X!     char buf[300];
  694. X!     int *ptr;
  695. X      char *aux;
  696. X!     int color[WIDTH];
  697. X      
  698. X      if (aux = getenv("XBDLIB"))
  699. X          strcpy(buf, aux);
  700. X--- 120,131 ----
  701. X  
  702. X  void load()
  703. X  {
  704. X!     FILE    *map;
  705. X!     int    i, j, k;
  706. X!     char    buf[300];
  707. X!     int    *ptr;
  708. X      char *aux;
  709. X!     int    color[WIDTH];
  710. X      
  711. X      if (aux = getenv("XBDLIB"))
  712. X          strcpy(buf, aux);
  713. X***************
  714. X*** 163,170 ****
  715. X  int levelnum;
  716. X  {
  717. X  
  718. X!     FILE           *levelfile;
  719. X!     char           buf[300], *ptr;
  720. X  
  721. X      Egc = Egc1;            /* don't blink EXIT */
  722. X      blobcollapse = FALSE;
  723. X--- 163,170 ----
  724. X  int levelnum;
  725. X  {
  726. X  
  727. X!     FILE    *levelfile;
  728. X!     char    buf[300], *ptr;
  729. X  
  730. X      Egc = Egc1;            /* don't blink EXIT */
  731. X      blobcollapse = FALSE;
  732. X***************
  733. X*** 269,275 ****
  734. X  /* Draw the score and level number */
  735. X  void    draw_score()
  736. X  {
  737. X!     char            buf[200];
  738. X      
  739. X      /* Build the output string */
  740. X      sprintf(buf, "sc:%d lv:%d ls:%d ds:%d dp:%d ti:%d %s", score, levelnum,
  741. X--- 269,275 ----
  742. X  /* Draw the score and level number */
  743. X  void    draw_score()
  744. X  {
  745. X!     char    buf[200];
  746. X      
  747. X      /* Build the output string */
  748. X      sprintf(buf, "sc:%d lv:%d ls:%d ds:%d dp:%d ti:%d %s", score, levelnum,
  749. X***************
  750. X*** 301,363 ****
  751. X  void    draw_field(redrawall)
  752. X  Bool    redrawall;
  753. X  {
  754. X-     char            c;
  755. X-     
  756. X      /* Iterate through each horizontal line */
  757. X      for (i = y - 1; i >= 0; --i) {
  758. X          for (j = 0; j < x; ++j) {
  759. X              if (field[i][j].changed || redrawall) {    
  760. X!                 c = field[i][j].content;
  761. X!                 switch (c) {
  762. X                      case GRASS:
  763. X!                         drawPgm((j << 1), (i << 4), ggc, _GPSET);
  764. X                          break;
  765. X                      case SPACE:
  766. X!                         drawPgm((j << 1), (i << 4), sgc, _GPSET);
  767. X                          break;
  768. X                      case PLAYER:
  769. X!                         drawPgm((j << 1), (i << 4), pgc, _GPSET);
  770. X                          break;
  771. X                      case WALL:
  772. X!                         drawPgm((j << 1), (i << 4), wgc, _GPSET);
  773. X                          break;
  774. X                      case MAGICWALL:
  775. X!                         drawPgm((j << 1), (i << 4), Wgc, _GPSET);
  776. X                          break;
  777. X                      case DIAMOND:
  778. X!                         drawPgm((j << 1), (i << 4), dgc, _GPSET);
  779. X                          break;
  780. X                      case BOULDER:
  781. X!                         drawPgm((j << 1), (i << 4), bgc, _GPSET);
  782. X                          break;
  783. X                      case EXPLOSION:
  784. X!                         drawPgm((j << 1), (i << 4), xgc, _GAND);
  785. X                          break;
  786. X                      case LMONSTER:
  787. X!                         drawPgm((j << 1), (i << 4), lgc, _GPSET);
  788. X                          break;
  789. X                      case RMONSTER:
  790. X!                         drawPgm((j << 1), (i << 4), rgc, _GPSET);
  791. X                          break;
  792. X                      case NUCBAL:
  793. X!                         drawPgm((j << 1), (i << 4), ngc, _GPSET);
  794. X                          break;
  795. X                      case BLOB:
  796. X!                         drawPgm((j << 1), (i << 4), Bgc, _GPSET);
  797. X                          break;
  798. X                      case TINKLE:
  799. X!                         drawPgm((j << 1), (i << 4), tgc, _GPSET);
  800. X                          break;
  801. X                      case EATER:
  802. X!                         drawPgm((j << 1), (i << 4), egc, _GPSET);
  803. X                          break;
  804. X                      case EXIT:
  805. X!                         drawPgm((j << 1), (i << 4), Egc, _GPSET);
  806. X                          break;
  807. X                      case STEEL:
  808. X                      default:
  809. X                          field[i][j].content = STEEL;
  810. X!                         drawPgm((j << 1), (i << 4), Sgc, _GPSET);
  811. X                          break;
  812. X                  }
  813. X                  field[i][j].changed = FALSE;
  814. X--- 301,360 ----
  815. X  void    draw_field(redrawall)
  816. X  Bool    redrawall;
  817. X  {
  818. X      /* Iterate through each horizontal line */
  819. X      for (i = y - 1; i >= 0; --i) {
  820. X          for (j = 0; j < x; ++j) {
  821. X              if (field[i][j].changed || redrawall) {    
  822. X!                 switch (field[i][j].content) {
  823. X                      case GRASS:
  824. X!                         drawPgm(j, i, ggc, _GPSET);
  825. X                          break;
  826. X                      case SPACE:
  827. X!                         drawPgm(j, i, sgc, _GPSET);
  828. X                          break;
  829. X                      case PLAYER:
  830. X!                         drawPgm(j, i, pgc, _GPSET);
  831. X                          break;
  832. X                      case WALL:
  833. X!                         drawPgm(j, i, wgc, _GPSET);
  834. X                          break;
  835. X                      case MAGICWALL:
  836. X!                         drawPgm(j, i, Wgc, _GPSET);
  837. X                          break;
  838. X                      case DIAMOND:
  839. X!                         drawPgm(j, i, dgc, _GPSET);
  840. X                          break;
  841. X                      case BOULDER:
  842. X!                         drawPgm(j, i, bgc, _GPSET);
  843. X                          break;
  844. X                      case EXPLOSION:
  845. X!                         drawPgm(j, i, xgc, _GAND);
  846. X                          break;
  847. X                      case LMONSTER:
  848. X!                         drawPgm(j, i, lgc, _GPSET);
  849. X                          break;
  850. X                      case RMONSTER:
  851. X!                         drawPgm(j, i, rgc, _GPSET);
  852. X                          break;
  853. X                      case NUCBAL:
  854. X!                         drawPgm(j, i, ngc, _GPSET);
  855. X                          break;
  856. X                      case BLOB:
  857. X!                         drawPgm(j, i, Bgc, _GPSET);
  858. X                          break;
  859. X                      case TINKLE:
  860. X!                         drawPgm(j, i, tgc, _GPSET);
  861. X                          break;
  862. X                      case EATER:
  863. X!                         drawPgm(j, i, egc, _GPSET);
  864. X                          break;
  865. X                      case EXIT:
  866. X!                         drawPgm(j, i, Egc, _GPSET);
  867. X                          break;
  868. X                      case STEEL:
  869. X                      default:
  870. X                          field[i][j].content = STEEL;
  871. X!                         drawPgm(j, i, Sgc, _GPSET);
  872. X                          break;
  873. X                  }
  874. X                  field[i][j].changed = FALSE;
  875. X***************
  876. X*** 375,382 ****
  877. X  {
  878. X      field[i][j].content = content;
  879. X      field[i][j].speed = 0;
  880. X-     field[i][j].changed = TRUE;
  881. X      field[i][j].stage = 0;
  882. X-     field[i][j].caught = TRUE;
  883. X      field[i][j].checked = FALSE;
  884. X  }
  885. X--- 372,379 ----
  886. X  {
  887. X      field[i][j].content = content;
  888. X      field[i][j].speed = 0;
  889. X      field[i][j].stage = 0;
  890. X      field[i][j].checked = FALSE;
  891. X+     field[i][j].changed = TRUE;
  892. X+     field[i][j].caught = TRUE;
  893. X  }
  894. X*** xbd.c    Thu Nov 29 11:52:24 1990
  895. X--- ../todo/pc-xbd2/xbd.c    Fri Mar  8 16:01:16 1991
  896. X***************
  897. X*** 12,17 ****
  898. X--- 12,24 ----
  899. X  /*********************************************/
  900. X  
  901. X  #include <stdio.h>
  902. X+ #include <fcntl.h>
  903. X+ #include <io.h>
  904. X+ #include <sys\types.h>
  905. X+ #include <sys\stat.h>
  906. X+ #include <malloc.h>
  907. X+ #include <string.h>
  908. X+ #include <memory.h>
  909. X  #include <conio.h>
  910. X  #include <ctype.h>
  911. X  #include <dos.h>
  912. X***************
  913. X*** 20,26 ****
  914. X  #include "xbd.h"
  915. X  
  916. X  
  917. X! 
  918. X  void (interrupt far *oldVect)();
  919. X  
  920. X  int count = 0;
  921. X--- 27,33 ----
  922. X  #include "xbd.h"
  923. X  
  924. X  
  925. X! char    *getenv();
  926. X  void (interrupt far *oldVect)();
  927. X  
  928. X  int count = 0;
  929. X***************
  930. X*** 27,33 ****
  931. X--- 34,42 ----
  932. X  Bool startCount = FALSE;
  933. X  Bool newLevel = FALSE;
  934. X  
  935. X+ Bool noSound = FALSE;
  936. X  
  937. X+ 
  938. X  void far interrupt newClock()
  939. X  {
  940. X      if (startCount && count)
  941. X***************
  942. X*** 108,128 ****
  943. X--- 117,161 ----
  944. X      else {
  945. X          switch (keyhit) {
  946. X              case K_LEFT:
  947. X+                 steal = FALSE;
  948. X                  curorder = LEFT;
  949. X                  gamestop = FALSE;
  950. X                  break;
  951. X              case K_UP:
  952. X+                 steal = FALSE;
  953. X                  curorder = UP;
  954. X                  gamestop = FALSE;
  955. X                  break;
  956. X              case K_DOWN:
  957. X+                 steal = FALSE;
  958. X                  curorder = DOWN;
  959. X                  gamestop = FALSE;
  960. X                  break;
  961. X              case K_RIGHT:
  962. X+                 steal = FALSE;
  963. X                  curorder = RIGHT;
  964. X                  gamestop = FALSE;
  965. X                  break;
  966. X+             case K_CTL_LEFT:
  967. X+                 steal = TRUE;
  968. X+                 curorder = LEFT;
  969. X+                 gamestop = FALSE;
  970. X+                 break;
  971. X+             case K_CTL_UP:
  972. X+                 steal = TRUE;
  973. X+                 curorder = UP;
  974. X+                 gamestop = FALSE;
  975. X+                 break;
  976. X+             case K_CTL_DOWN:
  977. X+                 steal = TRUE;
  978. X+                 curorder = DOWN;
  979. X+                 gamestop = FALSE;
  980. X+                 break;
  981. X+             case K_CTL_RIGHT:
  982. X+                 steal = TRUE;
  983. X+                 curorder = RIGHT;
  984. X+                 gamestop = FALSE;
  985. X+                 break;
  986. X          }
  987. X      }
  988. X  }
  989. X***************
  990. X*** 168,200 ****
  991. X      long        period;
  992. X      char        buf[50];
  993. X      int        i;
  994. X  
  995. X      byte    keyhit;
  996. X      byte    keytype;
  997. X      
  998. X      init_vars();
  999. X  
  1000. X      /* scan the command line for executing parameters and flags */
  1001. X      for (i = 1; i < argc; ++i) {
  1002. X          if (argv[i][0] == '-') {
  1003. X!             if (argv[i][1] == 'l') {
  1004. X!                 if (argv[i][2] == '\0' && i + 1 < argc) {
  1005. X!                     sscanf(argv[i + 1], "%d", &levelnum);
  1006. X!                     i++;    
  1007. X!                 } 
  1008. X!                 else
  1009. X!                     sscanf(argv[i] + 2, "%d", &levelnum);
  1010. X!             } 
  1011. X!             else {
  1012. X!                 printf("usage: xbd [-l <level>] \n");
  1013. X!                 exit(1);
  1014. X              }
  1015. X          }
  1016. X      }
  1017. X  
  1018. X      levelstart = levelnum;
  1019. X      init_level(levelnum);
  1020. X  
  1021. X      oldVect = _dos_getvect(0x1C);
  1022. X      xstart();
  1023. X  
  1024. X--- 201,269 ----
  1025. X      long        period;
  1026. X      char        buf[50];
  1027. X      int        i;
  1028. X+     char        *tmp;
  1029. X+     char        aux[200];
  1030. X+     char        soundName[255];
  1031. X  
  1032. X      byte    keyhit;
  1033. X      byte    keytype;
  1034. X      
  1035. X+     
  1036. X+     if (tmp = getenv("XBDLIB"))
  1037. X+         strcpy(aux, tmp);
  1038. X+     else
  1039. X+         strcpy(aux, LIB);
  1040. X+ 
  1041. X      init_vars();
  1042. X  
  1043. X      /* scan the command line for executing parameters and flags */
  1044. X      for (i = 1; i < argc; ++i) {
  1045. X          if (argv[i][0] == '-') {
  1046. X!             switch (argv[i][1]) {
  1047. X!                 case 'l' :
  1048. X!                     if (argv[i][2] == '\0' && i + 1 < argc) {
  1049. X!                         sscanf(argv[i + 1], "%d", &levelnum);
  1050. X!                         i++;    
  1051. X!                     }
  1052. X!                     else
  1053. X!                         sscanf(argv[i] + 2, "%d", &levelnum);
  1054. X!                     break;
  1055. X!                 case 's' :
  1056. X!                     noSound = TRUE;
  1057. X!                     soundDone = FALSE;
  1058. X!                     break;
  1059. X              }
  1060. X          }
  1061. X+         else {
  1062. X+             printf("usage: xbd [-l <level>] [-s] \n");
  1063. X+             printf("                              \n");
  1064. X+             printf("       -l = starting level    \n");
  1065. X+             printf("       -s = no digitized sound\n");
  1066. X+             exit(1);
  1067. X+         }
  1068. X      }
  1069. X  
  1070. X      levelstart = levelnum;
  1071. X      init_level(levelnum);
  1072. X  
  1073. X+     if (!noSound) {
  1074. X+         strcpy(soundName,aux);
  1075. X+         strcat(soundName,"\\explode");
  1076. X+         readSound(soundName, &sndExplode);
  1077. X+ 
  1078. X+         strcpy(soundName,aux);
  1079. X+         strcat(soundName,"\\whizz");
  1080. X+         readSound(soundName, &sndWhizz);
  1081. X+ 
  1082. X+         strcpy(soundName,aux);
  1083. X+         strcat(soundName,"\\gameover");
  1084. X+         readSound(soundName, &sndOver);
  1085. X+ 
  1086. X+         strcpy(soundName,aux);
  1087. X+         strcat(soundName,"\\yahoo");
  1088. X+         readSound(soundName, &sndYahoo);
  1089. X+     }
  1090. X+ 
  1091. X      oldVect = _dos_getvect(0x1C);
  1092. X      xstart();
  1093. X  
  1094. X***************
  1095. X*** 219,227 ****
  1096. X--- 288,306 ----
  1097. X              if (keytype == 'T') {
  1098. X                  switch (keyhit) {
  1099. X                      case K_ESC:
  1100. X+                         if (!noSound) {
  1101. X+                             playSound(sndOver);
  1102. X+                             while (!soundDone);
  1103. X+                         }
  1104. X                          xend();
  1105. X                          _dos_setvect(0x1C,oldVect);
  1106. X                          add_score();
  1107. X+                         if (!noSound) {
  1108. X+                             closeSound(&sndExplode);
  1109. X+                             closeSound(&sndWhizz);
  1110. X+                             closeSound(&sndOver);
  1111. X+                             closeSound(&sndYahoo);
  1112. X+                         }
  1113. X                          exit(-1);
  1114. X                          break;
  1115. X                      case K_D:
  1116. X***************
  1117. X*** 238,273 ****
  1118. X                          break;
  1119. X                  }
  1120. X              }
  1121. X-             /*
  1122. X-                 Handle of CTRL key is to be done
  1123. X-                 
  1124. X-             if ((*kbdStatus & 0x0F) == CTL_SHIFT) {
  1125. X-                 steal = TRUE;
  1126. X-                 if (keytype == 'T') {
  1127. X-                     switch (keyhit) {
  1128. X-                         case K_C:
  1129. X-                         case K_U:
  1130. X-                         case K_c:
  1131. X-                         case K_u:
  1132. X-                             xend();
  1133. X-                             _dos_setvect(0x1C,oldVect);
  1134. X-                             add_score();
  1135. X-                             exit(-1);
  1136. X-                             break;
  1137. X-                         case K_D:
  1138. X-                         case K_d:
  1139. X-                             curorder = KILL;
  1140. X-                         case K_R:
  1141. X-                         case    K_r:
  1142. X-                             draw_field(TRUE);
  1143. X-                             break;
  1144. X-                         default:
  1145. X-                             handle_key(keytype,keyhit);
  1146. X-                             break;
  1147. X-                     }
  1148. X-                 }
  1149. X-             }
  1150. X-             */
  1151. X              else
  1152. X                  handle_key(keytype,keyhit);
  1153. X          }
  1154. X--- 317,322 ----
  1155. X***************
  1156. X*** 274,283 ****
  1157. X          if (!gamestop)
  1158. X              startCount = TRUE;
  1159. X      }
  1160. X      xend();
  1161. X      _dos_setvect(0x1C,oldVect);
  1162. X      add_score();
  1163. X      exit(-1);
  1164. X  }
  1165. X- 
  1166. X  
  1167. X--- 323,344 ----
  1168. X          if (!gamestop)
  1169. X              startCount = TRUE;
  1170. X      }
  1171. X+ 
  1172. X+     if (!noSound) {
  1173. X+         playSound(sndOver);
  1174. X+         while (!soundDone);
  1175. X+     }
  1176. X+ 
  1177. X      xend();
  1178. X      _dos_setvect(0x1C,oldVect);
  1179. X      add_score();
  1180. X+ 
  1181. X+     if (!noSound) {
  1182. X+         closeSound(&sndExplode);
  1183. X+         closeSound(&sndWhizz);
  1184. X+         closeSound(&sndOver);
  1185. X+         closeSound(&sndYahoo);
  1186. X+     }
  1187. X      exit(-1);
  1188. X  }
  1189. X  
  1190. X*** xbd.h    Wed Dec 12 10:41:57 1990
  1191. X--- ../todo/pc-xbd2/xbd.h    Fri Mar  8 16:01:25 1991
  1192. X***************
  1193. X*** 3,45 ****
  1194. X  /*           BOULDER        DASH             */
  1195. X  /*                                           */
  1196. X  /*     Jeroen Houttuin, ETH Zurich, 1990     */
  1197. X  /*********************************************/
  1198. X  
  1199. X- #define w 35
  1200. X- #define h 26
  1201. X- #define LEVELPREFIX "xbdlv"
  1202. X  
  1203. X! #define SCORESIZE 18
  1204. X! #define LIB        "c:\\usr\\local\\games\\xbd"
  1205. X  
  1206. X  /* direction masks */
  1207. X! #define N 0
  1208. X! #define E 1
  1209. X! #define S 2
  1210. X! #define W 3
  1211. X! #define NODIR 4
  1212. X  
  1213. X! #define SPACEEXPLO    0
  1214. X! #define BOULDEXPLO    10
  1215. X! #define DIAEXPLO    20
  1216. X! #define PROPAGATED    10
  1217. X  
  1218. X! #define PLAYER              'p'
  1219. X! #define SPACE               ' '
  1220. X! #define LMONSTER            'l'    /* Right turning monster */
  1221. X! #define RMONSTER            'r'
  1222. X! #define GRASS               'g'
  1223. X! #define WALL                'w'
  1224. X! #define MAGICWALL           'W'    /* Expanding wall */
  1225. X! #define DIAMOND             'd'
  1226. X! #define STEEL               'S'
  1227. X! #define BOULDER             'b'
  1228. X! #define EXPLOSION           'x'
  1229. X! #define EXIT                'E'
  1230. X! #define EATER               'e'
  1231. X! #define NUCBAL              'n'    /* Nuclear ballon */
  1232. X! #define BLOB                'B'    /* lava */
  1233. X! #define TINKLE              't'    /* Tinkle wall */
  1234. X  
  1235. X  #define NB_EDIT_PGM        16
  1236. X  
  1237. X--- 3,59 ----
  1238. X  /*           BOULDER        DASH             */
  1239. X  /*                                           */
  1240. X  /*     Jeroen Houttuin, ETH Zurich, 1990     */
  1241. X+ /*                                           */
  1242. X+ /*                                           */
  1243. X+ /*      PC-VGA version from :                */
  1244. X+ /*                                           */
  1245. X+ /*        Herve SOULARD, Paris, 1990        */
  1246. X+ /*                                           */
  1247. X  /*********************************************/
  1248. X  
  1249. X  
  1250. X! #include "sound.h"
  1251. X  
  1252. X+ 
  1253. X+ #ifndef _XBD_H_
  1254. X+ 
  1255. X+ #define _XBD_H_
  1256. X+ 
  1257. X+ #define w                35
  1258. X+ #define h                26
  1259. X+ #define LEVELPREFIX        "xbdlv"
  1260. X+ 
  1261. X+ #define SCORESIZE        18
  1262. X+ #define LIB            ".\\lib"
  1263. X+ 
  1264. X  /* direction masks */
  1265. X! #define N                 0
  1266. X! #define E                 1
  1267. X! #define S                 2
  1268. X! #define W                 3
  1269. X! #define NODIR             4
  1270. X  
  1271. X! #define SPACEEXPLO         0
  1272. X! #define BOULDEXPLO        10
  1273. X! #define DIAEXPLO        20
  1274. X! #define PROPAGATED        10
  1275. X  
  1276. X! #define PLAYER            'p'
  1277. X! #define SPACE            ' '
  1278. X! #define LMONSTER        'l'    /* Right turning monster */
  1279. X! #define RMONSTER        'r'
  1280. X! #define GRASS            'g'
  1281. X! #define WALL            'w'
  1282. X! #define MAGICWALL        'W'    /* Expanding wall */
  1283. X! #define DIAMOND        'd'
  1284. X! #define STEEL            'S'
  1285. X! #define BOULDER        'b'
  1286. X! #define EXPLOSION        'x'
  1287. X! #define EXIT            'E'
  1288. X! #define EATER            'e'
  1289. X! #define NUCBAL            'n'    /* Nuclear ballon */
  1290. X! #define BLOB            'B'    /* lava */
  1291. X! #define TINKLE            't'    /* Tinkle wall */
  1292. X  
  1293. X  #define NB_EDIT_PGM        16
  1294. X  
  1295. X***************
  1296. X*** 47,86 ****
  1297. X  #define K_slash        '/'
  1298. X  
  1299. X  #ifndef byte
  1300. X! #define byte unsigned char
  1301. X  #endif
  1302. X  
  1303. X! #define ALT_SHIFT        8
  1304. X! #define CTL_SHIFT        4
  1305. X! #define LEFT_SHIFT        2
  1306. X! #define RIGHT_SHIFT        1
  1307. X  
  1308. X! #define K_HOME            71
  1309. X! #define K_END             79
  1310. X! #define K_UP              72
  1311. X! #define K_DOWN            80
  1312. X! #define K_PGUP            73
  1313. X! #define K_PGDOWN          81
  1314. X! #define K_LEFT            75
  1315. X! #define K_RIGHT           77
  1316. X! #define K_INS             82
  1317. X! #define K_DEL             83
  1318. X! #define K_BACKSPACE        8
  1319. X! #define K_RETURN          13
  1320. X! #define K_ESC             27
  1321. X! #define K_SPACE           32
  1322. X  
  1323. X! #define K_F1              59
  1324. X! #define K_F2              60
  1325. X! #define K_F3              61
  1326. X! #define K_F4              62
  1327. X! #define K_F5              63
  1328. X! #define K_F6              64
  1329. X! #define K_F7              65
  1330. X! #define K_F8              66
  1331. X! #define K_F9              67
  1332. X! #define K_F10             68
  1333. X  
  1334. X  #define K_C            'C'
  1335. X  #define K_U            'U'
  1336. X  #define K_c            'c'
  1337. X--- 61,106 ----
  1338. X  #define K_slash        '/'
  1339. X  
  1340. X  #ifndef byte
  1341. X! #define byte    unsigned char
  1342. X  #endif
  1343. X  
  1344. X! #define ALT_SHIFT         8
  1345. X! #define CTL_SHIFT         4
  1346. X! #define LEFT_SHIFT         2
  1347. X! #define RIGHT_SHIFT         1
  1348. X  
  1349. X! #define K_HOME            71
  1350. X! #define K_END            79
  1351. X! #define K_UP            72
  1352. X! #define K_DOWN            80
  1353. X! #define K_PGUP            73
  1354. X! #define K_PGDOWN        81
  1355. X! #define K_LEFT            75
  1356. X! #define K_RIGHT        77
  1357. X! #define K_INS            82
  1358. X! #define K_DEL            83
  1359. X! #define K_BACKSPACE         8
  1360. X! #define K_RETURN        13
  1361. X! #define K_ESC            27
  1362. X! #define K_SPACE        32
  1363. X  
  1364. X! #define K_CTL_UP        141
  1365. X! #define K_CTL_DOWN        145
  1366. X! #define K_CTL_LEFT        115
  1367. X! #define K_CTL_RIGHT        116
  1368. X  
  1369. X+ 
  1370. X+ #define K_F1            59
  1371. X+ #define K_F2            60
  1372. X+ #define K_F3            61
  1373. X+ #define K_F4            62
  1374. X+ #define K_F5            63
  1375. X+ #define K_F6            64
  1376. X+ #define K_F7            65
  1377. X+ #define K_F8            66
  1378. X+ #define K_F9            67
  1379. X+ #define K_F10            68
  1380. X+ 
  1381. X  #define K_C            'C'
  1382. X  #define K_U            'U'
  1383. X  #define K_c            'c'
  1384. X***************
  1385. X*** 96,102 ****
  1386. X  static int  far *kbdStatus   = (int  far *)0x00000417;  /* Etat du clavier */
  1387. X  static byte far *kbdBuffer   = (byte far *)0x00000400;  /* Tampon clavier  */
  1388. X  static int  far *kbdPtrRead  = (int  far *)0x0000041A;  /* Ptr lecture     */
  1389. X! static int  far *kbdPtrWrite = (int  far *)0x0000041C;  /* Ptr criture    */
  1390. X  
  1391. X  
  1392. X  #define Bool            enum Boolean
  1393. X--- 116,122 ----
  1394. X  static int  far *kbdStatus   = (int  far *)0x00000417;  /* Etat du clavier */
  1395. X  static byte far *kbdBuffer   = (byte far *)0x00000400;  /* Tampon clavier  */
  1396. X  static int  far *kbdPtrRead  = (int  far *)0x0000041A;  /* Ptr lecture     */
  1397. X! static int  far *kbdPtrWrite = (int  far *)0x0000041C;  /* Ptr criture    */
  1398. X  
  1399. X  
  1400. X  #define Bool            enum Boolean
  1401. X***************
  1402. X*** 106,154 ****
  1403. X  
  1404. X  
  1405. X  
  1406. X! char            *whitegc, *scoregc, *gc, *Bgc, *Bgc1, *Bgc2, *ngc, *egc, 
  1407. X!             *egc1, *egc2, *Egc1, *Wgc, *Wgc2, *Egc2, *Egc, *lgc, *lgc1,
  1408. X!             *lgc2, *rgc, *rgc1, *rgc2, *xgc, *Sgc, *bgc, *dgc, *dgc1, 
  1409. X!             *dgc2, *wgc, *pgc, *pgc1, *pgc2, *sgc, *ggc, *tgc, *tgc1,
  1410. X!                *tgc2, *tgc3;
  1411. X  
  1412. X! char            filename[300];    /* Current file name of this level */
  1413. X! char            levname[64];    /* Levelname */
  1414. X! int             i, j, ii, jj, jjj;
  1415. X! int             blobbreak;
  1416. X! int             critical;
  1417. X! int             curtime;        /* Current clock tick number */
  1418. X! int             blobcells;
  1419. X! int             tinkdur;    /* Tinkle duration */
  1420. X! Bool            tinkact;    /* Tinkle active   */
  1421. X! Bool            levincreased;
  1422. X! int             x, y, xin, yin, players, lives, levelnum, levelstart, speed,
  1423. X!                 diareq, diapoints, extradiapoints;
  1424. X! Bool            steal;        /* steal instead of go */
  1425. X! Bool            stoplevel, blobcollapse;
  1426. X  enum directs {
  1427. X      STAND, UP, DOWN, LEFT, RIGHT, KILL
  1428. X  };
  1429. X  
  1430. X  enum directs    curorder;    /* Current order which player has */
  1431. X! /* typed at the keyboard. */
  1432. X  
  1433. X  struct cell {
  1434. X!   char            content;
  1435. X!   Bool            changed;    /* has cell changed since last drawing */
  1436. X!   Bool            caught;    /* for BLOB */
  1437. X!   Bool            checked;    /* for BLOB algorithm */
  1438. X!   char            dir;
  1439. X!   short           speed;
  1440. X!   short           stage;    /* painting stage for blinking etc. */
  1441. X! }               field[h][w];
  1442. X  
  1443. X! Bool            gamestop;
  1444. X! Bool            scoreobs;    /* is score line obsolete ? */
  1445. X! int             levelnum;    /* Current level number */
  1446. X! int             lives;        /* Current number of lives */
  1447. X! int             score;        /* Total score */
  1448. X! int             speed;        /* Speed of game.  1 is slowest, 15 is
  1449. X                           * default */
  1450. X  
  1451. X  
  1452. X--- 126,179 ----
  1453. X  
  1454. X  
  1455. X  
  1456. X! char        *gc, *Bgc, *Bgc1, *Bgc2, *ngc, *egc, *egc1, *egc2, *Egc1, *Wgc,
  1457. X!         *Wgc2, *Egc2, *Egc, *lgc, *lgc1, *lgc2, *rgc, *rgc1, *rgc2, *xgc,
  1458. X!         *Sgc, *bgc, *dgc, *dgc1, *dgc2, *wgc, *pgc, *pgc1, *pgc2, *sgc,
  1459. X!         *ggc, *tgc, *tgc1, *tgc2, *tgc3;
  1460. X  
  1461. X! char        filename[300];    /* Current file name of this level */
  1462. X! char        levname[64];    /* Levelname */
  1463. X! int        i, j, ii, jj, jjj;
  1464. X! int        blobbreak;
  1465. X! int        critical;
  1466. X! int        curtime;        /* Current clock tick number */
  1467. X! int        blobcells;
  1468. X! int        tinkdur;        /* Tinkle duration */
  1469. X! Bool        tinkact;        /* Tinkle active   */
  1470. X! Bool        levincreased;
  1471. X! int        x, y, xin, yin, players, lives, levelnum, levelstart, speed,
  1472. X!         diareq, diapoints, extradiapoints;
  1473. X! Bool        steal;        /* steal instead of go */
  1474. X! Bool        stoplevel, blobcollapse;
  1475. X! 
  1476. X  enum directs {
  1477. X      STAND, UP, DOWN, LEFT, RIGHT, KILL
  1478. X  };
  1479. X  
  1480. X  enum directs    curorder;    /* Current order which player has */
  1481. X!                         /* typed at the keyboard. */
  1482. X  
  1483. X  struct cell {
  1484. X!   char    content;
  1485. X!   Bool    changed;            /* has cell changed since last drawing */
  1486. X!   Bool    caught;            /* for BLOB */
  1487. X!   Bool    checked;            /* for BLOB algorithm */
  1488. X!   char    dir;
  1489. X!   short    speed;
  1490. X!   short    stage;            /* painting stage for blinking etc. */
  1491. X! } field[h][w];
  1492. X  
  1493. X! Bool        gamestop;
  1494. X! Bool        scoreobs;            /* is score line obsolete ? */
  1495. X! int        levelnum;            /* Current level number */
  1496. X! int        lives;            /* Current number of lives */
  1497. X! int        score;            /* Total score */
  1498. X! int        speed;            /* Speed of game.  1 is slowest, 15 is
  1499. X                           * default */
  1500. X  
  1501. X+ struct sound    sndExplode;
  1502. X+ struct sound    sndWhizz;
  1503. X+ struct sound    sndOver;
  1504. X+ struct sound    sndYahoo;
  1505. X  
  1506. X+ #endif
  1507. X*** xbde.c    Sat Dec  1 12:55:38 1990
  1508. X--- ../todo/pc-xbd2/xbde.c    Fri Mar  8 16:01:35 1991
  1509. X***************
  1510. X*** 129,180 ****
  1511. X  {
  1512. X      switch (field[yC][xC].content) {
  1513. X          case GRASS:
  1514. X!             drawPgm((xC << 1), (yC << 4), ggc, _GPSET);
  1515. X              break;
  1516. X          case    SPACE:
  1517. X!             drawPgm((xC << 1), (yC << 4), sgc, _GPSET);
  1518. X              break;
  1519. X          case PLAYER:
  1520. X!             drawPgm((xC << 1), (yC << 4), pgc, _GPSET);
  1521. X              break;
  1522. X          case WALL:
  1523. X!             drawPgm((xC << 1), (yC << 4), wgc, _GPSET);
  1524. X              break;
  1525. X          case MAGICWALL:
  1526. X!             drawPgm((xC << 1), (yC << 4), Wgc, _GPSET);
  1527. X              break;
  1528. X          case DIAMOND:
  1529. X!             drawPgm((xC << 1), (yC << 4), dgc, _GPSET);
  1530. X              break;
  1531. X          case BOULDER:
  1532. X!             drawPgm((xC << 1), (yC << 4), bgc, _GPSET);
  1533. X              break;
  1534. X          case EXPLOSION:
  1535. X!             drawPgm((xC << 1), (yC << 4), xgc, _GPSET);
  1536. X              break;
  1537. X          case LMONSTER:
  1538. X!             drawPgm((xC << 1), (yC << 4), lgc, _GPSET);
  1539. X              break;
  1540. X          case RMONSTER:
  1541. X!             drawPgm((xC << 1), (yC << 4), rgc, _GPSET);
  1542. X              break;
  1543. X          case NUCBAL:
  1544. X!             drawPgm((xC << 1), (yC << 4), ngc, _GPSET);
  1545. X              break;
  1546. X          case BLOB:
  1547. X!             drawPgm((xC << 1), (yC << 4), Bgc, _GPSET);
  1548. X              break;
  1549. X          case TINKLE:
  1550. X!             drawPgm((xC << 1), (yC << 4), tgc, _GPSET);
  1551. X              break;
  1552. X          case EATER:
  1553. X!             drawPgm((xC << 1), (yC << 4), egc, _GPSET);
  1554. X              break;
  1555. X          case EXIT:
  1556. X!             drawPgm((xC << 1), (yC << 4), Egc, _GPSET);
  1557. X              break;
  1558. X          case STEEL:
  1559. X!             drawPgm((xC << 1), (yC << 4), Sgc, _GPSET);
  1560. X              break;
  1561. X      }
  1562. X  }
  1563. X--- 129,180 ----
  1564. X  {
  1565. X      switch (field[yC][xC].content) {
  1566. X          case GRASS:
  1567. X!             drawPgm(xC, yC, ggc, _GPSET);
  1568. X              break;
  1569. X          case    SPACE:
  1570. X!             drawPgm(xC, yC, sgc, _GPSET);
  1571. X              break;
  1572. X          case PLAYER:
  1573. X!             drawPgm(xC, yC, pgc, _GPSET);
  1574. X              break;
  1575. X          case WALL:
  1576. X!             drawPgm(xC, yC, wgc, _GPSET);
  1577. X              break;
  1578. X          case MAGICWALL:
  1579. X!             drawPgm(xC, yC, Wgc, _GPSET);
  1580. X              break;
  1581. X          case DIAMOND:
  1582. X!             drawPgm(xC, yC, dgc, _GPSET);
  1583. X              break;
  1584. X          case BOULDER:
  1585. X!             drawPgm(xC, yC, bgc, _GPSET);
  1586. X              break;
  1587. X          case EXPLOSION:
  1588. X!             drawPgm(xC, yC, xgc, _GPSET);
  1589. X              break;
  1590. X          case LMONSTER:
  1591. X!             drawPgm(xC, yC, lgc, _GPSET);
  1592. X              break;
  1593. X          case RMONSTER:
  1594. X!             drawPgm(xC, yC, rgc, _GPSET);
  1595. X              break;
  1596. X          case NUCBAL:
  1597. X!             drawPgm(xC, yC, ngc, _GPSET);
  1598. X              break;
  1599. X          case BLOB:
  1600. X!             drawPgm(xC, yC, Bgc, _GPSET);
  1601. X              break;
  1602. X          case TINKLE:
  1603. X!             drawPgm(xC, yC, tgc, _GPSET);
  1604. X              break;
  1605. X          case EATER:
  1606. X!             drawPgm(xC, yC, egc, _GPSET);
  1607. X              break;
  1608. X          case EXIT:
  1609. X!             drawPgm(xC, yC, Egc, _GPSET);
  1610. X              break;
  1611. X          case STEEL:
  1612. X!             drawPgm(xC, yC, Sgc, _GPSET);
  1613. X              break;
  1614. X      }
  1615. X  }
  1616. X***************
  1617. X*** 187,193 ****
  1618. X      c = field[yC][xC].content;
  1619. X      i = getIndex(c);
  1620. X      _setcolor(15);
  1621. X!     _rectangle(_GFILLINTERIOR, 625, 22+(i*20), 635, 26+(i*20));
  1622. X  }
  1623. X  
  1624. X  void unShowLocPgm(int xC, int yC)
  1625. X--- 187,193 ----
  1626. X      c = field[yC][xC].content;
  1627. X      i = getIndex(c);
  1628. X      _setcolor(15);
  1629. X!     _rectangle(_GFILLINTERIOR, 615, 22+(i*16), 625, 26+(i*16));
  1630. X  }
  1631. X  
  1632. X  void unShowLocPgm(int xC, int yC)
  1633. X***************
  1634. X*** 198,224 ****
  1635. X      c = field[yC][xC].content;
  1636. X      i = getIndex(c);
  1637. X      _setcolor(0);
  1638. X!     _rectangle(_GFILLINTERIOR, 625, 22+(i*20), 635, 26+(i*20));
  1639. X  }
  1640. X  
  1641. X  void drawAllPgm()
  1642. X  {
  1643. X!     drawPgm(75, 16, pgc, _GPSET); allPgms[0] = PLAYER;
  1644. X!     drawPgm(75, 36, sgc, _GPSET); allPgms[1] = SPACE;
  1645. X!     drawPgm(75, 56, lgc, _GPSET); allPgms[2] = LMONSTER;
  1646. X!     drawPgm(75, 76, rgc, _GPSET); allPgms[3] = RMONSTER;
  1647. X!     drawPgm(75, 96, ggc, _GPSET); allPgms[4] = GRASS;
  1648. X!     drawPgm(75,116, wgc, _GPSET);    allPgms[5] = WALL;
  1649. X!     drawPgm(75,136, Wgc, _GPSET);    allPgms[6] = MAGICWALL;
  1650. X!     drawPgm(75,156, dgc, _GPSET);    allPgms[7] = DIAMOND;
  1651. X!     drawPgm(75,176, Sgc, _GPSET);    allPgms[8] = STEEL;
  1652. X!     drawPgm(75,196, bgc, _GPSET);    allPgms[9] = BOULDER;
  1653. X!     drawPgm(75,216, xgc, _GPSET);    allPgms[10] = EXPLOSION;
  1654. X!     drawPgm(75,236, Egc, _GPSET);    allPgms[11] = EXIT;
  1655. X!     drawPgm(75,256, egc, _GPSET);    allPgms[12] = EATER;
  1656. X!     drawPgm(75,276, ngc, _GPSET);    allPgms[13] = NUCBAL;
  1657. X!     drawPgm(75,296, Bgc, _GPSET);    allPgms[14] = BLOB;
  1658. X!     drawPgm(75,316, tgc, _GPSET);    allPgms[15] = TINKLE;
  1659. X  }
  1660. X  
  1661. X  
  1662. X--- 198,224 ----
  1663. X      c = field[yC][xC].content;
  1664. X      i = getIndex(c);
  1665. X      _setcolor(0);
  1666. X!     _rectangle(_GFILLINTERIOR, 615, 22+(i*16), 625, 26+(i*16));
  1667. X  }
  1668. X  
  1669. X  void drawAllPgm()
  1670. X  {
  1671. X!     drawPgm(37,  1, pgc, _GPSET); allPgms[0] = PLAYER;
  1672. X!     drawPgm(37,  2, sgc, _GPSET); allPgms[1] = SPACE;
  1673. X!     drawPgm(37,  3, lgc, _GPSET); allPgms[2] = LMONSTER;
  1674. X!     drawPgm(37,  4, rgc, _GPSET); allPgms[3] = RMONSTER;
  1675. X!     drawPgm(37,  5, ggc, _GPSET); allPgms[4] = GRASS;
  1676. X!     drawPgm(37,  6, wgc, _GPSET);    allPgms[5] = WALL;
  1677. X!     drawPgm(37,  7, Wgc, _GPSET);    allPgms[6] = MAGICWALL;
  1678. X!     drawPgm(37,  8, dgc, _GPSET);    allPgms[7] = DIAMOND;
  1679. X!     drawPgm(37,  9, Sgc, _GPSET);    allPgms[8] = STEEL;
  1680. X!     drawPgm(37, 10, bgc, _GPSET);    allPgms[9] = BOULDER;
  1681. X!     drawPgm(37, 11, xgc, _GPSET);    allPgms[10] = EXPLOSION;
  1682. X!     drawPgm(37, 12, Egc, _GPSET);    allPgms[11] = EXIT;
  1683. X!     drawPgm(37, 13, egc, _GPSET);    allPgms[12] = EATER;
  1684. X!     drawPgm(37, 14, ngc, _GPSET);    allPgms[13] = NUCBAL;
  1685. X!     drawPgm(37, 15, Bgc, _GPSET);    allPgms[14] = BLOB;
  1686. X!     drawPgm(37, 16, tgc, _GPSET);    allPgms[15] = TINKLE;
  1687. X  }
  1688. X  
  1689. X  
  1690. X***************
  1691. X*** 307,313 ****
  1692. X  
  1693. X      drawAllPgm();
  1694. X      _setcolor(15);
  1695. X!     _rectangle(_GFILLINTERIOR, 580, 22+(curPgm*20), 590, 26+(curPgm*20));
  1696. X      showLocPgm(pX,pY);
  1697. X  
  1698. X      
  1699. X--- 307,313 ----
  1700. X  
  1701. X      drawAllPgm();
  1702. X      _setcolor(15);
  1703. X!     _rectangle(_GFILLINTERIOR, 570, 22+(curPgm*16), 580, 26+(curPgm*16));
  1704. X      showLocPgm(pX,pY);
  1705. X  
  1706. X      
  1707. X***************
  1708. X*** 358,381 ****
  1709. X                  switch (keyhit) {
  1710. X                      case K_PGUP :
  1711. X                          _setcolor(0);
  1712. X!                         _rectangle(_GFILLINTERIOR, 580, 22+(curPgm*20),
  1713. X!                                   590, 26+(curPgm*20));
  1714. X                          if (--curPgm < 0)
  1715. X                              curPgm = NB_EDIT_PGM - 1;
  1716. X                          _setcolor(15);
  1717. X!                         _rectangle(_GFILLINTERIOR, 580, 22+(curPgm*20),
  1718. X!                                   590, 26+(curPgm*20));
  1719. X                          break;
  1720. X  
  1721. X                      case K_PGDOWN :
  1722. X                          _setcolor(0);
  1723. X!                         _rectangle(_GFILLINTERIOR, 580, 22+(curPgm*20),
  1724. X!                                   590, 26+(curPgm*20));
  1725. X                          if (++curPgm >= NB_EDIT_PGM)
  1726. X                              curPgm = 0;
  1727. X                          _setcolor(15);
  1728. X!                         _rectangle(_GFILLINTERIOR, 580, 22+(curPgm*20),
  1729. X!                                   590, 26+(curPgm*20));
  1730. X                          break;
  1731. X  
  1732. X                      case K_LEFT :
  1733. X--- 358,381 ----
  1734. X                  switch (keyhit) {
  1735. X                      case K_PGUP :
  1736. X                          _setcolor(0);
  1737. X!                         _rectangle(_GFILLINTERIOR, 570, 22+(curPgm*16),
  1738. X!                                   580, 26+(curPgm*16));
  1739. X                          if (--curPgm < 0)
  1740. X                              curPgm = NB_EDIT_PGM - 1;
  1741. X                          _setcolor(15);
  1742. X!                         _rectangle(_GFILLINTERIOR, 570, 22+(curPgm*16),
  1743. X!                                   580, 26+(curPgm*16));
  1744. X                          break;
  1745. X  
  1746. X                      case K_PGDOWN :
  1747. X                          _setcolor(0);
  1748. X!                         _rectangle(_GFILLINTERIOR, 570, 22+(curPgm*16),
  1749. X!                                   580, 26+(curPgm*16));
  1750. X                          if (++curPgm >= NB_EDIT_PGM)
  1751. X                              curPgm = 0;
  1752. X                          _setcolor(15);
  1753. X!                         _rectangle(_GFILLINTERIOR, 570, 22+(curPgm*16),
  1754. X!                                   580, 26+(curPgm*16));
  1755. X                          break;
  1756. X  
  1757. X                      case K_LEFT :
  1758. X***************
  1759. X*** 418,447 ****
  1760. X          }
  1761. X          unsetCursor(pX, pY);
  1762. X              
  1763. X-         /* If the mouse moves with the button pressed, or the button is */
  1764. X-         /* pressed, draw the current block at that position */
  1765. X-         
  1766. X-         /*
  1767. X-         else 
  1768. X-             if (xev.type == MotionNotify) {
  1769. X-                 if (xev.xmotion.state & Button3Mask)
  1770. X-                     set_cell(xev.xmotion.y >> 5, xev.xmotion.x >> 5, SPACE);
  1771. X-                 else 
  1772. X-                     if (xev.xmotion.state & Button1Mask)
  1773. X-                         set_cell(xev.xmotion.y >> 5, xev.xmotion.x >> 5, curchar);
  1774. X-             } 
  1775. X-             else 
  1776. X-                 if (xev.type == ButtonPress) {
  1777. X-                     if (xev.xbutton.button == Button3)
  1778. X-                         set_cell(xev.xbutton.y >> 5, xev.xbutton.x >> 5, SPACE);
  1779. X-                     else
  1780. X-                         set_cell(xev.xbutton.y >> 5, xev.xbutton.x >> 5, curchar);
  1781. X-                 }
  1782. X-             draw_field(FALSE);
  1783. X-             XFlush(disp);
  1784. X-             
  1785. X-         */
  1786. X-         
  1787. X      } 
  1788. X        
  1789. X      xend();
  1790. X--- 418,423 ----
  1791. END_OF_FILE
  1792. if test 40831 -ne `wc -c <'patches02'`; then
  1793.     echo shar: \"'patches02'\" unpacked with wrong size!
  1794. fi
  1795. # end of 'patches02'
  1796. fi
  1797. if test -f 'sound.c' -a "${1}" != "-c" ; then 
  1798.   echo shar: Will not clobber existing file \"'sound.c'\"
  1799. else
  1800. echo shar: Extracting \"'sound.c'\" \(1943 characters\)
  1801. sed "s/^X//" >'sound.c' <<'END_OF_FILE'
  1802. X/****************************************************************************/
  1803. X/*                                                                          */
  1804. X/*    SOUND.C : C functions for digitized sound.                             */
  1805. X/*                                                                          */
  1806. X/*                                                                          */
  1807. X/*    (c) Herv Soulard, Version 1.0 - 10/01/1991                            */
  1808. X/*                       Version 1.1 - 01/02/1991                            */
  1809. X/*                                                                          */
  1810. X/****************************************************************************/
  1811. X
  1812. X
  1813. X#include <fcntl.h>
  1814. X#include <sys\types.h>
  1815. X#include <sys\stat.h>
  1816. X#include <io.h>
  1817. X#include <stdlib.h>
  1818. X#include <stdio.h>
  1819. X#include <string.h>
  1820. X#include <dos.h>
  1821. X#include <process.h>
  1822. X#include <malloc.h>
  1823. X
  1824. X#include "sound.h"
  1825. X
  1826. X#define SIZE    16384
  1827. X
  1828. Xstatic byte    convTab[256];
  1829. X
  1830. Xint readSound(char *fSound, struct sound *sSound)
  1831. X{
  1832. X    int            fd;
  1833. X    byte _huge    *ptr;
  1834. X    unsigned int    part;
  1835. X    unsigned long    i;
  1836. X    char            fName[255];
  1837. X    
  1838. X    strcpy(fName, fSound);
  1839. X    strcat(fName, ".psf");
  1840. X
  1841. X    if (_dos_open(fName, O_RDONLY, &fd) != 0) {
  1842. X        perror(fSound);
  1843. X        exit(1);
  1844. X    }
  1845. X    
  1846. X    lseek(fd, SEEK_SET, 0);
  1847. X    _dos_read(fd, sSound, sizeof(struct sound), &part);
  1848. X    
  1849. X    if (!strcmp(sSound->ident, IDENT)) {
  1850. X        for (i = 0; i < 256; i++) 
  1851. X            convTab[i] = (char)(((i * sSound->timer) / 256 ) + 1);
  1852. X
  1853. X        ptr = sSound->buffer = (byte _huge *)halloc(sSound->nbValues+1, 1);
  1854. X        if (ptr == NULL) {
  1855. X            perror("Can't allocate memory");
  1856. X            exit(1);
  1857. X        }
  1858. X
  1859. X        do {
  1860. X            _dos_read(fd, ptr, SIZE, &part);
  1861. X            ptr += part;
  1862. X        }
  1863. X        while (part == SIZE);
  1864. X    
  1865. X        ptr = sSound->buffer;
  1866. X
  1867. X        for (i = 0; i < sSound->nbValues; i++, ptr++)
  1868. X            *ptr = convTab[*ptr];
  1869. X        *ptr = '\0';
  1870. X        
  1871. X        _dos_close(fd);
  1872. X        return (1);
  1873. X    }
  1874. X    else {
  1875. X        _dos_close(fd);
  1876. X        return (0);
  1877. X    }
  1878. X}
  1879. X
  1880. X
  1881. Xvoid closeSound(struct sound *sSound)
  1882. X{
  1883. X    hfree(sSound->buffer);
  1884. X}
  1885. END_OF_FILE
  1886. if test 1943 -ne `wc -c <'sound.c'`; then
  1887.     echo shar: \"'sound.c'\" unpacked with wrong size!
  1888. fi
  1889. # end of 'sound.c'
  1890. fi
  1891. if test -f 'sound.h' -a "${1}" != "-c" ; then 
  1892.   echo shar: Will not clobber existing file \"'sound.h'\"
  1893. else
  1894. echo shar: Extracting \"'sound.h'\" \(1277 characters\)
  1895. sed "s/^X//" >'sound.h' <<'END_OF_FILE'
  1896. X/****************************************************************************/
  1897. X/*                                                                          */
  1898. X/*    SOUND.H : header for sound functions.                                  */
  1899. X/*                                                                          */
  1900. X/*            declare all structures for a sound sample                    */
  1901. X/*            declare all availabled functions                             */
  1902. X/*                                                                          */
  1903. X/*    (c) Herv Soulard, Version 1.0 - 10/01/1991                            */
  1904. X/*                       Version 1.1 - 01/02/1991                            */
  1905. X/*                                                                          */
  1906. X/****************************************************************************/
  1907. X
  1908. X
  1909. X#ifndef    byte
  1910. X#define    byte        unsigned char
  1911. X#endif
  1912. X
  1913. X#ifndef _SOUND_H_
  1914. X
  1915. X#define _SOUND_H_
  1916. X
  1917. X
  1918. X#define IDENT        "HS PC-Sound file format (V 1.0)"
  1919. X
  1920. Xstruct sound {
  1921. X    char            ident[32];
  1922. X    byte _huge    *buffer;
  1923. X    unsigned long    nbValues;
  1924. X    unsigned int    hertz;
  1925. X    byte            timer;
  1926. X    byte            mult;
  1927. X    char            memo[255];
  1928. X};
  1929. X
  1930. Xint readSound(char *, struct sound *);
  1931. Xvoid closeSound(struct sound *);
  1932. X
  1933. Xextern int playSound(struct sound);
  1934. Xextern byte soundDone;
  1935. X
  1936. X#endif
  1937. X    
  1938. END_OF_FILE
  1939. if test 1277 -ne `wc -c <'sound.h'`; then
  1940.     echo shar: \"'sound.h'\" unpacked with wrong size!
  1941. fi
  1942. # end of 'sound.h'
  1943. fi
  1944. if test -f 'sound_as.asm' -a "${1}" != "-c" ; then 
  1945.   echo shar: Will not clobber existing file \"'sound_as.asm'\"
  1946. else
  1947. echo shar: Extracting \"'sound_as.asm'\" \(5076 characters\)
  1948. sed "s/^X//" >'sound_as.asm' <<'END_OF_FILE'
  1949. X    TITLE    SOUND.ASM
  1950. X
  1951. X
  1952. X    PAGE   ,132
  1953. X
  1954. X
  1955. X
  1956. X;***************************************************************************
  1957. X;*                                       *
  1958. X;*    SOUND_AS.ASM : assembly functions for digitized sound           *
  1959. X;*                                       *
  1960. X;*    (c) Herv Soulard, Version 1.0 - 10/01/1991                        *
  1961. X;*                       Version 1.1 - 01/02/1991                        *
  1962. X;*                                       *
  1963. X;***************************************************************************
  1964. X
  1965. X
  1966. X
  1967. X    .MODEL    SMALL
  1968. X
  1969. X
  1970. X;---------------------------------------------------------------------------
  1971. X;
  1972. X;    Definition des constantes.
  1973. X;
  1974. X;---------------------------------------------------------------------------
  1975. X
  1976. X
  1977. XEOI        EQU    20h        ; Commande de fin d'interruption
  1978. X
  1979. XPIT_CTRL    EQU    43h        ; Port de controle du PIT
  1980. XPIT_HP        EQU    42h        ; Port de donnees du canal HP
  1981. XPIT_CLOCK    EQU    40h        ; Port de donnees du canal CLOCK
  1982. X
  1983. XPPI_CTRL    EQU    61h        ; Port de controle du PPI
  1984. X
  1985. XCTRL_HP_1    EQU    090h        ; Valeur de controle debut son
  1986. XCTRL_HP_2    EQU    0B6h        ; Valeur de controle fin son
  1987. X
  1988. XDATA_HP        EQU    0533h        ; Donnee pour fin son
  1989. X
  1990. XCTRL_CLK    EQU    34h        ; Valeur de controle CLOCK
  1991. X
  1992. XHP_ON        EQU    03h        ; Donnee pour HP actif
  1993. XHP_OFF        EQU    0FCh        ; Donnee pour HP inactif
  1994. X
  1995. X
  1996. Xsound        STRUC            ; Sound structure
  1997. Xident        DB    32 DUP (?)    ; identificator of sound file
  1998. Xbuffer        DD    ?        ; buffer for sampled values
  1999. XnbValues    DD    ?        ; nb of sampled values
  2000. Xhertz        DW    ?        ; 
  2001. Xtimer        DB    ?        ; value for It timer
  2002. Xmult        DB    ?        ; value of mult. freq.
  2003. Xmemo        DB    255 DUP (?)    ; comment for sound
  2004. Xsound        ENDS
  2005. X
  2006. X
  2007. X
  2008. X    .DATA
  2009. X
  2010. X
  2011. X        PUBLIC    _soundDone
  2012. X_soundDone    DB    1        ; le son est termine ?
  2013. X
  2014. Xvalues        DD    ?        
  2015. X
  2016. XmultMain    DB    ?
  2017. XmultAux        DB    ?
  2018. X
  2019. X
  2020. X    .CODE
  2021. X
  2022. X
  2023. XoldInt08    DD    ?
  2024. X
  2025. XnormClk        DW    ?        ; appeler l'ancienne int 08
  2026. Xtmp        DW    ?        ; tout les combien ?
  2027. X
  2028. X
  2029. X
  2030. X
  2031. X;---------------------------------------------------------------------------
  2032. X;
  2033. X;    Le son est joue par l'interruption horloge (frequence = hertz).
  2034. X;
  2035. X;---------------------------------------------------------------------------
  2036. X
  2037. X
  2038. X
  2039. X;------ Interruption horloge.
  2040. X;
  2041. X;
  2042. X
  2043. XNew_08    PROC    FAR
  2044. X
  2045. X    pushf
  2046. X    push    ax
  2047. X    push    bx
  2048. X    push    cx
  2049. X    push    si
  2050. X    push    ds
  2051. X    push    es
  2052. X
  2053. X    mov    al, 20h
  2054. X    out    20h, al
  2055. X
  2056. X    mov    ax, DGROUP
  2057. X    mov    ds, ax
  2058. X
  2059. X    les    si, dword ptr values    ; Pointeur sur les donnees
  2060. X    mov    al, byte ptr es:[si]    ; al = nouvelle donnee
  2061. X    or    al, al
  2062. X    jz    n1            ; Fin des donnees ?
  2063. X
  2064. Xn4:
  2065. X    dec    byte ptr multAux
  2066. X    jnz    n3
  2067. X
  2068. X    mov    ah, byte ptr multMain
  2069. X    mov    byte ptr multAux, ah
  2070. X
  2071. X    inc    si            ; prochaine donnee
  2072. X
  2073. Xn3:
  2074. X    out    PIT_HP, al
  2075. X
  2076. X    jnz    n2            ; fin des premiers 64Ko ?
  2077. X
  2078. X    mov    ax, 1000h
  2079. X    add    word ptr values + 2, ax    ; segment suivant
  2080. X
  2081. Xn2:
  2082. X    mov    word ptr values, si    ; Mise a jour pointeur
  2083. X    jmp    fin
  2084. X    
  2085. Xn1:
  2086. X    cli                ; Fini de jouer, on remet tout
  2087. X
  2088. X    mov    al, CTRL_HP_2        ; Initialisation du son a 0
  2089. X    out    PIT_CTRL, al
  2090. X    mov    ax, DATA_HP
  2091. X    out    PIT_HP, al
  2092. X    mov    al, ah
  2093. X    out    PIT_HP, al
  2094. X
  2095. X    mov    al, CTRL_CLK        ; Initialisation de la frequence
  2096. X    out    PIT_CTRL, al        ; d'horloge
  2097. X    mov    al, 0
  2098. X    out    PIT_CLOCK, al
  2099. X    out    PIT_CLOCK, al
  2100. X
  2101. X    in    al, PPI_CTRL        ; HP inactif
  2102. X    and    al, HP_OFF
  2103. X    out    PPI_CTRL, al
  2104. X
  2105. X    mov    byte ptr _soundDone, 1    ; fin du son
  2106. X
  2107. X    les    bx, dword ptr cs:oldInt08
  2108. X    xor    ax, ax
  2109. X    mov    ds, ax
  2110. X    mov    word ptr ds:[20h], bx    ; remet l'interruption 08
  2111. X    mov    word ptr ds:[22h], es
  2112. X    
  2113. Xfin:
  2114. X    pop    es
  2115. X    pop    ds
  2116. X    pop    si
  2117. X    pop    cx
  2118. X    pop    bx
  2119. X
  2120. X    dec    word ptr cs:tmp
  2121. X    jnz    fin1
  2122. X    
  2123. X    mov    ax, word ptr cs:normClk
  2124. X    mov    word ptr cs:tmp, ax
  2125. X    pop    ax
  2126. X    popf
  2127. X    jmp    dword ptr cs:oldInt08
  2128. X
  2129. Xfin1:
  2130. X    pop    ax
  2131. X    popf
  2132. X
  2133. X    iret
  2134. X
  2135. X
  2136. XNew_08    ENDP
  2137. X
  2138. X
  2139. X
  2140. X;---------------------------------------------------------------------------
  2141. X;
  2142. X;    Fonctions. 
  2143. X;
  2144. X;---------------------------------------------------------------------------
  2145. X
  2146. X
  2147. X;---------------------------------------------------------------------------
  2148. X;
  2149. X;    playSound :
  2150. X;
  2151. X;        plays the sound contains in the buffer precised
  2152. X;        by the parameter.
  2153. X;
  2154. X;        initializes the interrupt 8 to the New_08 function
  2155. X;        and prepares HP port to receive digitized sound.
  2156. X;
  2157. X;
  2158. X;    interface :
  2159. X;
  2160. X;        int playSound(struct sound sSound)
  2161. X;
  2162. X
  2163. X
  2164. X    PUBLIC    _playSound
  2165. X
  2166. X_playSound    PROC
  2167. X
  2168. X    push    bp
  2169. X    mov    bp, sp
  2170. X
  2171. Xarg    EQU    <[BP+04h]>
  2172. X
  2173. X    push    di
  2174. X    push    es
  2175. X
  2176. X    cmp    byte ptr _soundDone, 1
  2177. X    jz    e2
  2178. X    
  2179. X    mov    ax, 0
  2180. X    jmp    e1
  2181. X
  2182. Xe2:
  2183. X    mov    byte ptr _soundDone, 0
  2184. X
  2185. X    les    di, arg.buffer
  2186. X    mov    word ptr values, di
  2187. X    mov    ax, es
  2188. X    mov    word ptr values+2, ax
  2189. X
  2190. X    mov    ax, 10
  2191. X    mul    arg.hertz
  2192. X    mov    cx, 182
  2193. X    div    cx
  2194. X    mov    word ptr cs:normClk, ax
  2195. X    mov    word ptr cs:tmp, ax
  2196. X
  2197. X    mov    al, arg.mult
  2198. X    mov    byte ptr multMain, al
  2199. X    mov    byte ptr multAux, al
  2200. X
  2201. X
  2202. X    push    ds
  2203. X    pop    es
  2204. X
  2205. X    cli
  2206. X
  2207. X    xor    ax, ax
  2208. X    mov    es, ax
  2209. X    les    bx, dword ptr es:[20h]    ; Sauvegarde le vecteur It CLK
  2210. X    mov    word ptr cs:oldInt08, bx
  2211. X    mov    word ptr cs:oldInt08 + 2, es
  2212. X
  2213. X    mov    es, ax
  2214. X    mov    ax, OFFSET New_08    ; Nouvelle interruption CLK
  2215. X    mov    word ptr es:[20h], ax
  2216. X    mov    ax, cs
  2217. X    mov    word ptr es:[22h], ax
  2218. X    
  2219. X    mov    al, CTRL_HP_2        ; Initialisation du son a 0
  2220. X    out    PIT_CTRL, al
  2221. X    mov    al, 0
  2222. X    out    PIT_HP, al
  2223. X    out    PIT_HP, al
  2224. X
  2225. X    mov    al, CTRL_CLK        ; Initialisation de la frequence
  2226. X    out    PIT_CTRL, al        ; d'horloge
  2227. X    mov    al, arg.timer
  2228. X    out    PIT_CLOCK, al
  2229. X    mov    al, 0
  2230. X    out    PIT_CLOCK, al
  2231. X
  2232. X    mov    al, CTRL_HP_1        ; Prepare le canal HP a recevoir
  2233. X    out    PIT_CTRL, al        ; de nouvelles frequence
  2234. X
  2235. X    in    al, PPI_CTRL        ; HP actif
  2236. X    or    al, HP_ON
  2237. X    out    PPI_CTRL, al
  2238. X    
  2239. X    sti
  2240. X
  2241. X    mov    ax, 1
  2242. Xe1:
  2243. X    pop    es
  2244. X    pop    di
  2245. X
  2246. X    mov    sp, bp
  2247. X    pop    bp
  2248. X
  2249. X    ret
  2250. X
  2251. X
  2252. X_playSound    ENDP
  2253. X
  2254. X
  2255. X    END
  2256. END_OF_FILE
  2257. if test 5076 -ne `wc -c <'sound_as.asm'`; then
  2258.     echo shar: \"'sound_as.asm'\" unpacked with wrong size!
  2259. fi
  2260. # end of 'sound_as.asm'
  2261. fi
  2262. echo shar: End of archive 2 \(of 4\).
  2263. cp /dev/null ark2isdone
  2264. MISSING=""
  2265. for I in 1 2 3 4 ; do
  2266.     if test ! -f ark${I}isdone ; then
  2267.     MISSING="${MISSING} ${I}"
  2268.     fi
  2269. done
  2270. if test "${MISSING}" = "" ; then
  2271.     echo You have unpacked all 4 archives.
  2272.     rm -f ark[1-9]isdone
  2273. else
  2274.     echo You still need to unpack the following archives:
  2275.     echo "        " ${MISSING}
  2276. fi
  2277. ##  End of shell archive.
  2278. exit 0
  2279.